{extend name="iframe" /}
{block name="css"}
<link rel="stylesheet" href="__AD__/module/admin.css?v=316">
<link rel="stylesheet" href="__AD_CSS__/home.css">
{/block}
{block name="body"}
<!-- 正文开始 -->

    <div class="layui-card-body">
        <blockquote class="layui-elem-quote layui-text">
            当前时间：<span class="text-danger" id="time"></span>      今日浏览量：<span class="text-danger" id="see_log"></span>
        </blockquote>
        <div class="layui-fluid ew-console-wrapper">
            <div class="layui-row layui-col-space15">
                <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            销售额<span class="layui-badge layui-badge-green pull-right">日</span>
                        </div>
                        <div class="layui-card-body">
                            <p class="lay-big-font">{$info.order_add_today_sum|default=0}</p>
                            <p>订单量<span class="pull-right">{$info.order_add_today|default=0} 单</span></p>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            新增用户<span class="layui-badge layui-badge-green pull-right">日</span>
                        </div>
                        <div class="layui-card-body">
                            <p class="lay-big-font">{$info.user_add_today|default=0} <span style="font-size: 24px;line-height: 1;">位</span></p>
                            <p>总用户<span class="pull-right">{$info.user_total|default=0} 人</span></p>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            订单量<span class="layui-badge layui-badge-red pull-right">周</span>
                        </div>
                        <div class="layui-card-body">
                            <p class="lay-big-font">{$info.order_add_week|default=0}</p>
                            <p>转化率<span class="pull-right">{$info.conversion_rate|default=0}%</span></p>
                        </div>
                    </div>
                </div>
                <div class="layui-col-xs12 layui-col-sm6 layui-col-md3">
                    <div class="layui-card">
                        <div class="layui-card-header">
                            销售额<span class="layui-badge layui-badge-blue pull-right">总</span>
                        </div>
                        <div class="layui-card-body">
                            <p class="lay-big-font"><span style="font-size: 26px;line-height: 1;">¥</span>{$info.order_month_sum|default=0}</p>
                            <p>总销售额<span class="pull-right">{$info.order_sum|default=0} 万</span></p>
                        </div>
                    </div>
                </div>
            </div>
            <div class="layui-row layui-col-space15">
                <div class="layui-col-lg7 layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">今日新增</div>
                        <div class="layui-card-body">
                            {volist name='data' id='v' empty='$empty'}
                            <div class="console-user-group">
                                <img src="__AD_IMG__/head.png" class="console-user-group-head">
                                <div class="console-user-group-name">{$v.name|default=''}</div>
                                <div class="console-user-group-desc">{$v.mobile|substr_replace='****',3,4}</div>
                                {if $v.is_active}<span class="layui-badge layui-badge-green">已激活</span>{else}<span class="layui-badge layui-badge-red">未激活</span>{/if}
                            </div>
                            {/volist}
                        </div>
                    </div>
                </div>
                <div class="layui-col-lg5 layui-col-md6">
                    <div class="layui-card">
                        <div class="layui-card-header">版本信息</div>
                        <div class="layui-card-body">
                            <table class="layui-table layui-text">
                                <tr>
                                    <td>服务环境</td>
                                    <td>{$Think.PHP_OS} - {$Request.server.SERVER_SOFTWARE} - {$Think.PHP_VERSION}</td>
                                </tr>
                                <tr>
                                    <td>本机域名</td>
                                    <td>{$Request.domain}</td>
                                </tr>
                                <tr>
                                    <td>运行内存</td>
                                    <td>{:ini_get('memory_limit')}</td>
                                </tr>
                                <tr>
                                    <td>数据库</td>
                                    <td>5.7</td>
                                </tr>
                                <tr>
                                    <td>执行时间</td>
                                    <td>{:ini_get('max_execution_time')}s</td>
                                </tr>
                                <tr>
                                    <td>上传限制</td>
                                    <td>{:ini_get('upload_max_filesize')}</td>
                                </tr>
                                <tr>
                                    <td>系统时间</td>
                                    <td>{$Think.now}</td>
                                </tr>
                                <tr>
                                    <td>获取渠道</td>
                                    <td>
                                        <a href="http://api.qcwd.com" class="layui-btn layui-btn-danger" target="_blank">获取授权</a>
                                        <a href="http://qcwd.com" target="_blank" class="layui-btn">立即下载</a>
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

{/block}
{block name="js"}
<!-- js部分 -->
<script type="text/javascript">
    //顶部时间
    function getTime(){
        var myDate = new Date();
        var myYear = myDate.getFullYear(); //获取完整的年份(4位,1970-????)
        var myMonth = myDate.getMonth()+1; //获取当前月份(0-11,0代表1月)
        var myToday = myDate.getDate(); //获取当前日(1-31)
        var myDay = myDate.getDay(); //获取当前星期X(0-6,0代表星期天)
        var myHour = myDate.getHours(); //获取当前小时数(0-23)
        var myMinute = myDate.getMinutes(); //获取当前分钟数(0-59)
        var mySecond = myDate.getSeconds(); //获取当前秒数(0-59)
        var week = ['星期日','星期一','星期二','星期三','星期四','星期五','星期六'];
        var nowTime;

        nowTime = myYear+'-'+fillZero(myMonth)+'-'+fillZero(myToday)+'&nbsp;&nbsp;'+fillZero(myHour)+':'+fillZero(myMinute)+':'+fillZero(mySecond)+'&nbsp;&nbsp;'+week[myDay]+'&nbsp;&nbsp;';
        //console.log(nowTime);
        $('#time').html(nowTime);
    };
    function fillZero(str){
        var realNum;
        if(str<10){
            realNum	= '0'+str;
        }else{
            realNum	= str;
        }
        return realNum;
    }
    setInterval(getTime,1000);
    //获取今日浏览量
    setTimeout(getSeeLog,1000);
    setInterval(getSeeLog,60000);
    function getSeeLog()
    {
        $.post('seelog.html',function(res){
            $('#see_log').html(res.data);
        });
    }
</script>
{/block}
